import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    /**
     * type: 0 目录、1 页面、2 外链
     * path: 访问路径
     * meta: title、icon
     * componentPath: 组件路径
     */
    menuList: [
      {
        path: "/system",
        meta: { title: "系统设置", type: 0, icon: "el-icon-setting" },
        children: [
          {
            path: "/system/menu",
            meta: { title: "系统菜单", type: 1 },
            componentPath: "/system/menu/index.vue",
          },
          {
            path: "/system/notice",
            meta: { title: "系统通知", type: 1 },
            componentPath: "/system/notice/index.vue",
          },
        ],
      },
      {
        path: "/permission",
        meta: { title: "系统权限", type: 0, icon: "el-icon-setting" },
        children: [
          {
            path: "/permission",
            meta: { title: "系统权限", type: 1 },
            componentPath: "/permission/index.vue",
          },
        ],
      },
      {
        path: "/dashboard",
        meta: { title: "主控台", type: 1, icon: "el-icon-setting" },
        componentPath: "/dashboard/index.vue",
      },
    ],
  },
  mutations: {},
  actions: {},
  modules: {},
});
